﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JacOS.Programs
{
    class edit
    {
        public static void run()
        {
        Prompt:
            Console.Write("\nWould you like to see help for the edit program y/n  >> ");
            var ShowHelp = Console.ReadLine();
            if (ShowHelp == "y")
            {
                Console.Write("\n" + Commands.edit.helpdoc + "\n");
            }
            else if (ShowHelp == "n")
            {
                //Procede
            }
            else
            {
                goto Prompt;
            }

            MyGlobals.text = "";
            string line;
            var num = 1;
            while (true)
            {
                Console.Write(num + ":");
                num = num + 1;
                line = Console.ReadLine();
                if (line == "end")
                {
                    break;
                }
                if (line == "save")
                {
                    MyGlobals.textSVG = MyGlobals.text;
                    break;
                }
                MyGlobals.text = MyGlobals.text + ("\n" + line);
            }

        }
    }
}
